package structs.term.dept.course.section;

/**
 * Contains the enrollment values for some course.
 * @author SJP
 *
 */
public class Enrollment {
	/**
	 * max enrollment
	 */
	private int capacity;
	/**
	 * previous enrollment
	 */
	private int previous;
	/**
	 * estimated enrollment
	 */
	private int estimate;
	/**
	 * current enrollment
	 */
	private int current;

	/**
	 * Create a new Enrollment record with known values for
	 * capacity, previous, estimated, and current enrollments
	 * @param cap
	 * @param prev
	 * @param est
	 * @param cur
	 */
	public Enrollment(int cap, int prev, int est, int cur) {
		capacity = cap;
		previous = prev;
		estimate = est;
		current = cur;
	}
	
	/**
	 * Create a new Enrollment record with default values
	 * for capacity, previous, estimated, and current enrollments
	 */
	public Enrollment() {
		this(0,0,0,0);
	}
	
	/**
	 * Create a new Enrollment record with a known capacity and
	 * default values for previous, estimated, and current enrollments
	 * @param cap
	 */
	public Enrollment(int cap) {
		this(cap,0,0,0);
	}
	
	/**
	 * Create a new Enrollment record with known capacity and estimated
	 * enrollment and default values for previous and current enrollments.
	 * @param cap
	 * @param est
	 */
	public Enrollment(int cap, int est) {
		this(cap,0,est,0);
	}
	
	/**
	 * Create a new Enrollment record with known capacity, previous, and
	 * estimated enrollments and default current enrollment.
	 * @param cap
	 * @param prev
	 * @param est
	 */
	public Enrollment(int cap, int prev, int est) {
		this(cap,prev,est,0);
	}

	/**
	 * @return capacity
	 */
	public int getCap() {return capacity;}
	
	/**
	 * Change the capacity and return the new value.
	 * @param cap
	 * @return
	 */
	public int setCap(int cap) {
		capacity = cap;
		return getCap();
	}
	
	/**
	 * @return previous
	 */
	public int getPrev() {return previous;}
	
	/**
	 * Change the previous enrollment and return the new value.
	 * @param cap
	 * @return
	 */
	public int setPrev(int prev) {
		previous = prev;
		return getPrev();
	}
	
	/**
	 * @return estimate
	 */
	public int getEst() {return estimate;}

	/**
	 * Change the estimated enrollment and return the new value.
	 * @param cap
	 * @return
	 */
	public int setEst(int est) {
		estimate = est;
		return getEst();
	}
	
	/**
	 * @return current
	 */
	public int getCur() {return current;}
	
	/**
	 * Change the current enrollment and return the new value.
	 * @param cap
	 * @return
	 */
	public int setCur(int cur) {
		current = cur;
		return getCur();
	}
	
	/**
	 * TODO
	 */
	public void termRollover(){}

}
